use :: libc;
extern "C" {
    pub type _IO_wide_data;
    pub type _IO_codecvt;
    pub type _IO_marker;
    fn fprintf(_: *mut FILE, _: *const i8, _: ...) -> i32;
    fn fscanf(_: *mut FILE, _: *const i8, _: ...) -> i32;
    fn perror(__s: *const i8);
    fn __assert_fail(
        __assertion: *const i8,
        __file: *const i8,
        __line: u32,
        __function: *const i8,
    ) -> !;
    fn __errno_location() -> *mut i32;
    fn exp(_: f64) -> f64;
    fn rand() -> i32;
    fn malloc(_: u64) -> *mut libc::c_void;
    fn free(_: *mut libc::c_void);
    fn memcpy(_: *mut libc::c_void, _: *const libc::c_void, _: u64) -> *mut libc::c_void;
}
pub type size_t = u64;
pub type __off_t = i64;
pub type __off64_t = i64;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct _IO_FILE {
    pub _flags: i32,
    pub _IO_read_ptr: *mut i8,
    pub _IO_read_end: *mut i8,
    pub _IO_read_base: *mut i8,
    pub _IO_write_base: *mut i8,
    pub _IO_write_ptr: *mut i8,
    pub _IO_write_end: *mut i8,
    pub _IO_buf_base: *mut i8,
    pub _IO_buf_end: *mut i8,
    pub _IO_save_base: *mut i8,
    pub _IO_backup_base: *mut i8,
    pub _IO_save_end: *mut i8,
    pub _markers: *mut _IO_marker,
    pub _chain: *mut _IO_FILE,
    pub _fileno: i32,
    pub _flags2: i32,
    pub _old_offset: __off_t,
    pub _cur_column: u16,
    pub _vtable_offset: i8,
    pub _shortbuf: [i8; 1],
    pub _lock: *mut libc::c_void,
    pub _offset: __off64_t,
    pub _codecvt: *mut _IO_codecvt,
    pub _wide_data: *mut _IO_wide_data,
    pub _freeres_list: *mut _IO_FILE,
    pub _freeres_buf: *mut libc::c_void,
    pub __pad5: size_t,
    pub _mode: i32,
    pub _unused2: [i8; 20],
}
pub type _IO_lock_t = ();
pub type FILE = _IO_FILE;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct genann {
    pub inputs: i32,
    pub hidden_layers: i32,
    pub hidden: i32,
    pub outputs: i32,
    pub activation_hidden: genann_actfun,
    pub activation_output: genann_actfun,
    pub total_weights: i32,
    pub total_neurons: i32,
    pub weight: *mut f64,
    pub output: *mut f64,
    pub delta: *mut f64,
}
pub type genann_actfun = Option<unsafe extern "C" fn(*const genann, f64) -> f64>;
#[no_mangle]
pub extern "C" fn genann_act_hidden_indirect(mut ann: *const genann, mut a: f64) -> f64 {
    return unsafe { ((*ann).activation_hidden).expect("non-null function pointer")(ann, a) };
}
#[no_mangle]
pub extern "C" fn genann_act_output_indirect(mut ann: *const genann, mut a: f64) -> f64 {
    return unsafe { ((*ann).activation_output).expect("non-null function pointer")(ann, a) };
}
#[no_mangle]
pub static mut sigmoid_dom_min: f64 = -15.0f64;
#[no_mangle]
pub static mut sigmoid_dom_max: f64 = 15.0f64;
#[no_mangle]
pub static mut interval: f64 = 0.;
#[no_mangle]
pub static mut lookup: [f64; 4096] = [0.; 4096];
#[no_mangle]
pub extern "C" fn genann_act_sigmoid(mut _ann: *const genann, mut a: f64) -> f64 {
    if a < -45.0f64 {
        return 0 as i32 as f64;
    }
    if a > 45.0f64 {
        return 1 as i32 as f64;
    }
    return 1.0f64 / (1 as i32 as f64 + (unsafe { exp(-a) }));
}
#[no_mangle]
pub extern "C" fn genann_init_sigmoid_lookup(mut ann: *const genann) {
    let f: f64 = ((unsafe { sigmoid_dom_max }) - (unsafe { sigmoid_dom_min })) / 4096 as i32 as f64;
    let mut i: i32 = 0;
    (unsafe { interval = 4096 as i32 as f64 / (sigmoid_dom_max - sigmoid_dom_min) });
    i = 0 as i32;
    while i < 4096 as i32 {
        (unsafe { lookup[i as usize] = genann_act_sigmoid(ann, sigmoid_dom_min + f * i as f64) });
        i += 1;
    }
}
#[no_mangle]
pub extern "C" fn genann_act_sigmoid_cached(mut _ann: *const genann, mut a: f64) -> f64 {
    if a.is_nan() as i32 == 0 {
    } else {
        (unsafe {
            __assert_fail(
                b"!isnan(a)\0" as *const u8 as *const i8,
                b"genann.c\0" as *const u8 as *const i8,
                87 as i32 as u32,
                (*::core::mem::transmute::<&[u8; 57], &[i8; 57]>(
                    b"double genann_act_sigmoid_cached(const genann *, double)\0",
                ))
                .as_ptr(),
            )
        });
    }
    if a < (unsafe { sigmoid_dom_min }) {
        return unsafe { lookup[0 as i32 as usize] };
    }
    if a >= (unsafe { sigmoid_dom_max }) {
        return unsafe { lookup[(4096 as i32 - 1 as i32) as usize] };
    }
    let mut j: size_t =
        ((a - (unsafe { sigmoid_dom_min })) * (unsafe { interval }) + 0.5f64) as size_t;
    if (j >= 4096 as i32 as u64) as i32 as i64 != 0 {
        return unsafe { lookup[(4096 as i32 - 1 as i32) as usize] };
    }
    return unsafe { lookup[j as usize] };
}
#[no_mangle]
pub extern "C" fn genann_act_linear(mut _ann: *const genann, mut a: f64) -> f64 {
    return a;
}
#[no_mangle]
pub extern "C" fn genann_act_threshold(mut _ann: *const genann, mut a: f64) -> f64 {
    return (a > 0 as i32 as f64) as i32 as f64;
}
#[no_mangle]
pub extern "C" fn genann_init(
    mut inputs: i32,
    mut hidden_layers: i32,
    mut hidden: i32,
    mut outputs: i32,
) -> *mut genann {
    if hidden_layers < 0 as i32 {
        return std::ptr::null_mut::<genann>();
    }
    if inputs < 1 as i32 {
        return std::ptr::null_mut::<genann>();
    }
    if outputs < 1 as i32 {
        return std::ptr::null_mut::<genann>();
    }
    if hidden_layers > 0 as i32 && hidden < 1 as i32 {
        return std::ptr::null_mut::<genann>();
    }
    let hidden_weights: i32 = if hidden_layers != 0 {
        (inputs + 1 as i32) * hidden + (hidden_layers - 1 as i32) * (hidden + 1 as i32) * hidden
    } else {
        0 as i32
    };
    let output_weights: i32 = (if hidden_layers != 0 {
        hidden + 1 as i32
    } else {
        inputs + 1 as i32
    }) * outputs;
    let total_weights: i32 = hidden_weights + output_weights;
    let total_neurons: i32 = inputs + hidden * hidden_layers + outputs;
    let size: i32 = (::core::mem::size_of::<genann>() as u64).wrapping_add(
        (::core::mem::size_of::<f64>() as u64)
            .wrapping_mul((total_weights + total_neurons + (total_neurons - inputs)) as u64),
    ) as i32;
    let mut ret: *mut genann = (unsafe { malloc(size as u64) }) as *mut genann;
    if ret.is_null() {
        return std::ptr::null_mut::<genann>();
    }
    (unsafe { (*ret).inputs = inputs });
    (unsafe { (*ret).hidden_layers = hidden_layers });
    (unsafe { (*ret).hidden = hidden });
    (unsafe { (*ret).outputs = outputs });
    (unsafe { (*ret).total_weights = total_weights });
    (unsafe { (*ret).total_neurons = total_neurons });
    (unsafe {
        (*ret).weight =
            (ret as *mut i8).offset(::core::mem::size_of::<genann>() as u64 as isize) as *mut f64
    });
    (unsafe { (*ret).output = ((*ret).weight).offset((*ret).total_weights as isize) });
    (unsafe { (*ret).delta = ((*ret).output).offset((*ret).total_neurons as isize) });
    genann_randomize(ret);
    (unsafe {
        (*ret).activation_hidden =
            Some(genann_act_sigmoid_cached as unsafe extern "C" fn(*const genann, f64) -> f64)
    });
    (unsafe {
        (*ret).activation_output =
            Some(genann_act_sigmoid_cached as unsafe extern "C" fn(*const genann, f64) -> f64)
    });
    genann_init_sigmoid_lookup(ret);
    return ret;
}
#[no_mangle]
pub extern "C" fn genann_read(mut in_0: *mut FILE) -> *mut genann {
    let mut inputs: i32 = 0;
    let mut hidden_layers: i32 = 0;
    let mut hidden: i32 = 0;
    let mut outputs: i32 = 0;
    let mut rc: i32 = 0;
    (unsafe { *__errno_location() = 0 as i32 });
    rc = unsafe {
        fscanf(
            in_0,
            b"%d %d %d %d\0" as *const u8 as *const i8,
            &mut inputs as *mut i32,
            &mut hidden_layers as *mut i32,
            &mut hidden as *mut i32,
            &mut outputs as *mut i32,
        )
    };
    if rc < 4 as i32 || (unsafe { *__errno_location() }) != 0 as i32 {
        (unsafe { perror(b"fscanf\0" as *const u8 as *const i8) });
        return std::ptr::null_mut::<genann>();
    }
    let mut ann: *mut genann = genann_init(inputs, hidden_layers, hidden, outputs);
    let mut i: i32 = 0;
    i = 0 as i32;
    while i < (unsafe { (*ann).total_weights }) {
        (unsafe { *__errno_location() = 0 as i32 });
        rc = unsafe {
            fscanf(
                in_0,
                b" %le\0" as *const u8 as *const i8,
                ((*ann).weight).offset(i as isize),
            )
        };
        if rc < 1 as i32 || (unsafe { *__errno_location() }) != 0 as i32 {
            (unsafe { perror(b"fscanf\0" as *const u8 as *const i8) });
            genann_free(ann);
            return std::ptr::null_mut::<genann>();
        }
        i += 1;
    }
    return ann;
}
#[no_mangle]
pub extern "C" fn genann_copy(mut ann: *const genann) -> *mut genann {
    let size: i32 = (::core::mem::size_of::<genann>() as u64).wrapping_add(
        (::core::mem::size_of::<f64>() as u64).wrapping_mul(
            ((unsafe { (*ann).total_weights })
                + (unsafe { (*ann).total_neurons })
                + ((unsafe { (*ann).total_neurons }) - (unsafe { (*ann).inputs })))
                as u64,
        ),
    ) as i32;
    let mut ret: *mut genann = (unsafe { malloc(size as u64) }) as *mut genann;
    if ret.is_null() {
        return std::ptr::null_mut::<genann>();
    }
    (unsafe {
        memcpy(
            ret as *mut libc::c_void,
            ann as *const libc::c_void,
            size as u64,
        )
    });
    (unsafe {
        (*ret).weight =
            (ret as *mut i8).offset(::core::mem::size_of::<genann>() as u64 as isize) as *mut f64
    });
    (unsafe { (*ret).output = ((*ret).weight).offset((*ret).total_weights as isize) });
    (unsafe { (*ret).delta = ((*ret).output).offset((*ret).total_neurons as isize) });
    return ret;
}
#[no_mangle]
pub extern "C" fn genann_randomize(mut ann: *mut genann) {
    let mut i: i32 = 0;
    i = 0 as i32;
    while i < (unsafe { (*ann).total_weights }) {
        let mut r: f64 = (unsafe { rand() }) as f64 / 2147483647 as i32 as f64;
        (unsafe { *((*ann).weight).offset(i as isize) = r - 0.5f64 });
        i += 1;
    }
}
#[no_mangle]
pub extern "C" fn genann_free(mut ann: *mut genann) {
    (unsafe { free(ann as *mut libc::c_void) });
}
#[no_mangle]
pub extern "C" fn genann_run(mut ann: *const genann, mut inputs: *const f64) -> *const f64 {
    let mut w: *const f64 = unsafe { (*ann).weight };
    let mut o: *mut f64 = unsafe { ((*ann).output).offset((*ann).inputs as isize) };
    let mut i: *const f64 = unsafe { (*ann).output };
    (unsafe {
        memcpy(
            (*ann).output as *mut libc::c_void,
            inputs as *const libc::c_void,
            (::core::mem::size_of::<f64>() as u64).wrapping_mul((*ann).inputs as u64),
        )
    });
    let mut h: i32 = 0;
    let mut j: i32 = 0;
    let mut k: i32 = 0;
    if (unsafe { (*ann).hidden_layers }) == 0 {
        let mut ret: *mut f64 = o;
        j = 0 as i32;
        while j < (unsafe { (*ann).outputs }) {
            let fresh0 = w;
            w = unsafe { w.offset(1) };
            let mut sum: f64 = (unsafe { *fresh0 }) * -1.0f64;
            k = 0 as i32;
            while k < (unsafe { (*ann).inputs }) {
                let fresh1 = w;
                w = unsafe { w.offset(1) };
                sum += (unsafe { *fresh1 }) * (unsafe { *i.offset(k as isize) });
                k += 1;
            }
            let fresh2 = o;
            o = unsafe { o.offset(1) };
            (unsafe { *fresh2 = genann_act_output_indirect(ann, sum) });
            j += 1;
        }
        return ret;
    }
    j = 0 as i32;
    while j < (unsafe { (*ann).hidden }) {
        let fresh3 = w;
        w = unsafe { w.offset(1) };
        let mut sum_0: f64 = (unsafe { *fresh3 }) * -1.0f64;
        k = 0 as i32;
        while k < (unsafe { (*ann).inputs }) {
            let fresh4 = w;
            w = unsafe { w.offset(1) };
            sum_0 += (unsafe { *fresh4 }) * (unsafe { *i.offset(k as isize) });
            k += 1;
        }
        let fresh5 = o;
        o = unsafe { o.offset(1) };
        (unsafe { *fresh5 = genann_act_hidden_indirect(ann, sum_0) });
        j += 1;
    }
    i = unsafe { i.offset((*ann).inputs as isize) };
    h = 1 as i32;
    while h < (unsafe { (*ann).hidden_layers }) {
        j = 0 as i32;
        while j < (unsafe { (*ann).hidden }) {
            let fresh6 = w;
            w = unsafe { w.offset(1) };
            let mut sum_1: f64 = (unsafe { *fresh6 }) * -1.0f64;
            k = 0 as i32;
            while k < (unsafe { (*ann).hidden }) {
                let fresh7 = w;
                w = unsafe { w.offset(1) };
                sum_1 += (unsafe { *fresh7 }) * (unsafe { *i.offset(k as isize) });
                k += 1;
            }
            let fresh8 = o;
            o = unsafe { o.offset(1) };
            (unsafe { *fresh8 = genann_act_hidden_indirect(ann, sum_1) });
            j += 1;
        }
        i = unsafe { i.offset((*ann).hidden as isize) };
        h += 1;
    }
    let mut ret_0: *const f64 = o;
    j = 0 as i32;
    while j < (unsafe { (*ann).outputs }) {
        let fresh9 = w;
        w = unsafe { w.offset(1) };
        let mut sum_2: f64 = (unsafe { *fresh9 }) * -1.0f64;
        k = 0 as i32;
        while k < (unsafe { (*ann).hidden }) {
            let fresh10 = w;
            w = unsafe { w.offset(1) };
            sum_2 += (unsafe { *fresh10 }) * (unsafe { *i.offset(k as isize) });
            k += 1;
        }
        let fresh11 = o;
        o = unsafe { o.offset(1) };
        (unsafe { *fresh11 = genann_act_output_indirect(ann, sum_2) });
        j += 1;
    }
    if (unsafe { w.offset_from((*ann).weight) }) as i64 == (unsafe { (*ann).total_weights }) as i64
    {
    } else {
        (unsafe {
            __assert_fail(
                b"w - ann->weight == ann->total_weights\0" as *const u8 as *const i8,
                b"genann.c\0" as *const u8 as *const i8,
                271 as i32 as u32,
                (*::core::mem::transmute::<&[u8; 57], &[i8; 57]>(
                    b"const double *genann_run(const genann *, const double *)\0",
                ))
                .as_ptr(),
            )
        });
    }
    if (unsafe { o.offset_from((*ann).output) }) as i64 == (unsafe { (*ann).total_neurons }) as i64
    {
    } else {
        (unsafe {
            __assert_fail(
                b"o - ann->output == ann->total_neurons\0" as *const u8 as *const i8,
                b"genann.c\0" as *const u8 as *const i8,
                272 as i32 as u32,
                (*::core::mem::transmute::<&[u8; 57], &[i8; 57]>(
                    b"const double *genann_run(const genann *, const double *)\0",
                ))
                .as_ptr(),
            )
        });
    }
    return ret_0;
}
#[no_mangle]
pub extern "C" fn genann_train(
    mut ann: *const genann,
    mut inputs: *const f64,
    mut desired_outputs: *const f64,
    mut learning_rate: f64,
) {
    genann_run(ann, inputs);
    let mut h: i32 = 0;
    let mut j: i32 = 0;
    let mut k: i32 = 0;
    let mut o: *const f64 = unsafe {
        ((*ann).output)
            .offset((*ann).inputs as isize)
            .offset(((*ann).hidden * (*ann).hidden_layers) as isize)
    };
    let mut d: *mut f64 =
        unsafe { ((*ann).delta).offset(((*ann).hidden * (*ann).hidden_layers) as isize) };
    let mut t: *const f64 = desired_outputs;
    if Some(genann_act_output_indirect as unsafe extern "C" fn(*const genann, f64) -> f64)
        == Some(genann_act_linear as unsafe extern "C" fn(*const genann, f64) -> f64)
        || (unsafe { (*ann).activation_output })
            == Some(genann_act_linear as unsafe extern "C" fn(*const genann, f64) -> f64)
    {
        j = 0 as i32;
        while j < (unsafe { (*ann).outputs }) {
            let fresh12 = t;
            t = unsafe { t.offset(1) };
            let fresh13 = o;
            o = unsafe { o.offset(1) };
            let fresh14 = d;
            d = unsafe { d.offset(1) };
            (unsafe { *fresh14 = *fresh12 - *fresh13 });
            j += 1;
        }
    } else {
        j = 0 as i32;
        while j < (unsafe { (*ann).outputs }) {
            let fresh15 = d;
            d = unsafe { d.offset(1) };
            (unsafe { *fresh15 = (*t - *o) * *o * (1.0f64 - *o) });
            o = unsafe { o.offset(1) };
            t = unsafe { t.offset(1) };
            j += 1;
        }
    }
    h = (unsafe { (*ann).hidden_layers }) - 1 as i32;
    while h >= 0 as i32 {
        let mut o_0: *const f64 = unsafe {
            ((*ann).output)
                .offset((*ann).inputs as isize)
                .offset((h * (*ann).hidden) as isize)
        };
        let mut d_0: *mut f64 = unsafe { ((*ann).delta).offset((h * (*ann).hidden) as isize) };
        let dd: *const f64 =
            unsafe { ((*ann).delta).offset(((h + 1 as i32) * (*ann).hidden) as isize) };
        let ww: *const f64 = unsafe {
            ((*ann).weight)
                .offset((((*ann).inputs + 1 as i32) * (*ann).hidden) as isize)
                .offset((((*ann).hidden + 1 as i32) * (*ann).hidden * h) as isize)
        };
        j = 0 as i32;
        while j < (unsafe { (*ann).hidden }) {
            let mut delta: f64 = 0 as i32 as f64;
            k = 0 as i32;
            while k
                < (if h == (unsafe { (*ann).hidden_layers }) - 1 as i32 {
                    unsafe { (*ann).outputs }
                } else {
                    unsafe { (*ann).hidden }
                })
            {
                let forward_delta: f64 = unsafe { *dd.offset(k as isize) };
                let windex: i32 = k * ((unsafe { (*ann).hidden }) + 1 as i32) + (j + 1 as i32);
                let forward_weight: f64 = unsafe { *ww.offset(windex as isize) };
                delta += forward_delta * forward_weight;
                k += 1;
            }
            (unsafe { *d_0 = *o_0 * (1.0f64 - *o_0) * delta });
            d_0 = unsafe { d_0.offset(1) };
            o_0 = unsafe { o_0.offset(1) };
            j += 1;
        }
        h -= 1;
    }
    let mut d_1: *const f64 =
        unsafe { ((*ann).delta).offset(((*ann).hidden * (*ann).hidden_layers) as isize) };
    let mut w: *mut f64 = unsafe {
        ((*ann).weight).offset(
            (if (*ann).hidden_layers != 0 {
                ((*ann).inputs + 1 as i32) * (*ann).hidden
                    + ((*ann).hidden + 1 as i32) * (*ann).hidden * ((*ann).hidden_layers - 1 as i32)
            } else {
                0 as i32
            }) as isize,
        )
    };
    let i: *const f64 = unsafe {
        ((*ann).output).offset(
            (if (*ann).hidden_layers != 0 {
                (*ann).inputs + (*ann).hidden * ((*ann).hidden_layers - 1 as i32)
            } else {
                0 as i32
            }) as isize,
        )
    };
    j = 0 as i32;
    while j < (unsafe { (*ann).outputs }) {
        let fresh16 = w;
        w = unsafe { w.offset(1) };
        (unsafe { *fresh16 += *d_1 * learning_rate * -1.0f64 });
        k = 1 as i32;
        while k
            < (if (unsafe { (*ann).hidden_layers }) != 0 {
                unsafe { (*ann).hidden }
            } else {
                unsafe { (*ann).inputs }
            }) + 1 as i32
        {
            let fresh17 = w;
            w = unsafe { w.offset(1) };
            (unsafe { *fresh17 += *d_1 * learning_rate * *i.offset((k - 1 as i32) as isize) });
            k += 1;
        }
        d_1 = unsafe { d_1.offset(1) };
        j += 1;
    }
    if (unsafe { w.offset_from((*ann).weight) }) as i64 == (unsafe { (*ann).total_weights }) as i64
    {
    } else {
        (unsafe {
            __assert_fail(
                b"w - ann->weight == ann->total_weights\0" as *const u8 as *const i8,
                b"genann.c\0" as *const u8 as *const i8,
                362 as i32 as u32,
                (*::core::mem::transmute::<&[u8; 74], &[i8; 74]>(
                    b"void genann_train(const genann *, const double *, const double *, double)\0",
                ))
                .as_ptr(),
            )
        });
    }
    h = (unsafe { (*ann).hidden_layers }) - 1 as i32;
    while h >= 0 as i32 {
        let mut d_2: *const f64 = unsafe { ((*ann).delta).offset((h * (*ann).hidden) as isize) };
        let mut i_0: *const f64 = unsafe {
            ((*ann).output).offset(
                (if h != 0 {
                    (*ann).inputs + (*ann).hidden * (h - 1 as i32)
                } else {
                    0 as i32
                }) as isize,
            )
        };
        let mut w_0: *mut f64 = unsafe {
            ((*ann).weight).offset(
                (if h != 0 {
                    ((*ann).inputs + 1 as i32) * (*ann).hidden
                        + ((*ann).hidden + 1 as i32) * (*ann).hidden * (h - 1 as i32)
                } else {
                    0 as i32
                }) as isize,
            )
        };
        j = 0 as i32;
        while j < (unsafe { (*ann).hidden }) {
            let fresh18 = w_0;
            w_0 = unsafe { w_0.offset(1) };
            (unsafe { *fresh18 += *d_2 * learning_rate * -1.0f64 });
            k = 1 as i32;
            while k
                < (if h == 0 as i32 {
                    unsafe { (*ann).inputs }
                } else {
                    unsafe { (*ann).hidden }
                }) + 1 as i32
            {
                let fresh19 = w_0;
                w_0 = unsafe { w_0.offset(1) };
                (unsafe {
                    *fresh19 += *d_2 * learning_rate * *i_0.offset((k - 1 as i32) as isize)
                });
                k += 1;
            }
            d_2 = unsafe { d_2.offset(1) };
            j += 1;
        }
        h -= 1;
    }
}
#[no_mangle]
pub extern "C" fn genann_write(mut ann: *const genann, mut out: *mut FILE) {
    (unsafe {
        fprintf(
            out,
            b"%d %d %d %d\0" as *const u8 as *const i8,
            (*ann).inputs,
            (*ann).hidden_layers,
            (*ann).hidden,
            (*ann).outputs,
        )
    });
    let mut i: i32 = 0;
    i = 0 as i32;
    while i < (unsafe { (*ann).total_weights }) {
        (unsafe {
            fprintf(
                out,
                b" %.20e\0" as *const u8 as *const i8,
                *((*ann).weight).offset(i as isize),
            )
        });
        i += 1;
    }
}
